﻿using AutoMapper;
using Microsoft.Extensions.DependencyInjection;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using TalksLog.Entities;
using TalksLog.UI.Models.BindingModels;

namespace TalksLog.UI.InjectingExt
{
    internal static class AutoMapperInjectingExt
    {
        internal static void AddAutoMapper(this IServiceCollection services)
        {
            var config = new MapperConfiguration(cfg => cfg.CreateMap<RegisterAccountBM, Account>());
            var mapper = new Mapper(config);

            services.AddSingleton<IMapper>(p => mapper);
        }
    }
}
